//
//  MyPersonalfansTableViewCell.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/9/23.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "MyPersonalfansTableViewCell.h"

@implementation MyPersonalfansTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.iconImage];
        [self.iconImage addSubview:self.headportraitBut];
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.attentionBut];
        [self.contentView addSubview:self.djImage];
        [self.contentView addSubview:self.djLabel];
        [self.contentView addSubview:self.browseImage];
        [self.contentView addSubview:self.numLabel];
        [self.contentView addSubview:self.lineLabel];
        
        [self setAdapterView];//位置
    }
    return self;
}
- (void)setAdapterView{
    
    //阴影
    _iconImage.sd_layout
    .topSpaceToView(self.contentView, kHeightScale(10))
    .leftSpaceToView(self.contentView, kWidthScale(15))
    .widthIs(kWidthScale(50))
    .heightIs(kHeightScale(50));
    
    _headportraitBut.sd_layout
    .topSpaceToView(self.iconImage, kHeightScale(2.5))
    .leftSpaceToView(self.iconImage, kWidthScale(2.5))
    .widthIs(kWidthScale(45))
    .heightIs(kHeightScale(45));
    
    _nameLabel.sd_layout
    .topSpaceToView(self.contentView, kHeightScale(18))
    .leftSpaceToView(self.iconImage, kWidthScale(5))
    .widthIs(kWidthScale(120))
    .autoHeightRatio(0);
    
    _attentionBut.sd_layout
    .topSpaceToView(self.contentView, kHeightScale(24))
    .rightSpaceToView(self.contentView, kWidthScale(15))
    .widthIs(kWidthScale(44))
    .heightIs(kHeightScale(22));
    
    _djImage.sd_layout
    .topSpaceToView(self.nameLabel, kHeightScale(5))
    .leftSpaceToView(self.iconImage, kWidthScale(5))
    .widthIs(kWidthScale(10))
    .heightIs(kHeightScale(10));
    
    _djLabel.sd_layout
    .centerYEqualToView(self.djImage)
    .leftSpaceToView(self.djImage, kWidthScale(5))
    .widthIs(kWidthScale(30))
    .autoHeightRatio(0);
    
    _browseImage.sd_layout
    .centerYEqualToView(self.djImage)
    .leftSpaceToView(self.djLabel, kWidthScale(10))
    .widthIs(kWidthScale(13))
    .heightIs(kHeightScale(8.6));
    
    _numLabel.sd_layout
    .centerYEqualToView(self.djImage)
    .leftSpaceToView(self.browseImage, kWidthScale(5))
    .widthIs(kWidthScale(100/2))
    .autoHeightRatio(0);
    
    _lineLabel.sd_layout
    .bottomSpaceToView(self.contentView, 0)
    .leftSpaceToView(self.contentView, 0)
    .rightSpaceToView(self.contentView, 0)
    .heightIs(kHeightScale(1));
    
}

- (UIView *)iconImage
{
    if (!_iconImage)
    {
        _iconImage=[[UIView alloc] init];
        _iconImage.backgroundColor = [UIColor colorWithRed:(213.0/255) green:(213.0/255) blue:(213.0/255) alpha:1];
        _iconImage.layer.masksToBounds=YES;
        _iconImage.layer.cornerRadius=25;
        _iconImage.layer.shadowColor = [UIColor blackColor].CGColor;
        _iconImage.layer.shadowOffset = CGSizeMake(-3, 1);
        _iconImage.layer.shadowOpacity = 0.4;
        _iconImage.layer.shadowRadius = 2.0;
        _iconImage.clipsToBounds = NO;
    }
    return _iconImage;
}
- (UIButton *)headportraitBut
{
    if (!_headportraitBut)
    {
        _headportraitBut= [[UIButton alloc] init];
        _headportraitBut.layer.masksToBounds=YES;
        _headportraitBut.layer.cornerRadius=kWidthScale(22.5);
        [_headportraitBut setBackgroundImage:[UIImage imageNamed:@"1111"] forState:UIControlStateNormal];
    }
    return _headportraitBut;
}
- (UILabel *)nameLabel
{
    if (!_nameLabel)
    {
        _nameLabel=[[UILabel alloc] init];
        _nameLabel.text=@"迪丽热巴";
        _nameLabel.textColor=[UIColor colorWithHexString:@"#333333"];
        _nameLabel.font=[UIFont systemFontOfSize:kWidthScale(15)];
    }
    return _nameLabel;
}
- (UIButton *)attentionBut
{
    if (!_attentionBut)
    {
        _attentionBut=[[UIButton alloc] init];
        _attentionBut.layer.borderWidth=1;
        _attentionBut.layer.cornerRadius=kWidthScale(5);
        _attentionBut.layer.borderColor=[UIColor colorWithRed:(76.0/255) green:(15.0/255) blue:(204.0/255) alpha:1].CGColor;
        [_attentionBut setTitle:@"关注" forState:UIControlStateNormal];
        _attentionBut.titleLabel.font=[UIFont systemFontOfSize:kWidthScale(12)];
        [_attentionBut setTitleColor:[UIColor colorWithHexString:@"5b1fd5"] forState:UIControlStateNormal];
        _attentionBut.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return _attentionBut;
}
- (UIImageView *)djImage
{
    if (!_djImage)
    {
        _djImage=[[UIImageView alloc] init];
        _djImage.image=[UIImage imageNamed:@"dengji1"];
        //_djImage.backgroundColor=[UIColor colorWithHexString:@"#999999"];
    }
    return _djImage;
}
- (UILabel *)djLabel
{
    if (!_djLabel)
    {
        _djLabel=[[UILabel alloc] init];
        _djLabel.text=@"100级";
        _djLabel.textColor=[UIColor colorWithHexString:@"#999999"];
        _djLabel.font=[UIFont systemFontOfSize:kWidthScale(10)];
    }
    return _djLabel;
}
- (UIImageView *)browseImage
{
    if (!_browseImage)
    {
        _browseImage=[[UIImageView alloc] init];
        _browseImage.image=[UIImage imageNamed:@"liulans"];
    }
    return _browseImage;
}
- (UILabel *)numLabel
{
    if (!_numLabel)
    {
        _numLabel=[[UILabel alloc] init];
        _numLabel.text=@"100";
        _numLabel.textColor=[UIColor colorWithHexString:@"#999999"];
        _numLabel.font=[UIFont systemFontOfSize:kWidthScale(10)];
    }
    return _numLabel;
}
- (UILabel *)lineLabel
{
    if (!_lineLabel)
    {
        _lineLabel=[[UILabel alloc] init];
        _lineLabel.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"fengexian11111"]];
        //_lineLabel.backgroundColor=[UIColor blackColor];
    }
    return _lineLabel;
}

@end
